<template>
	<view>
		<!-- <button type="primary" @click="config.path('/pagesA/login/login')">去登录</button> -->
		<view class="info-wrap" @click="config.path('/pagesA/user/user')">
			<view class="flex">
				<!-- <image style="width:105rpx;height: 105rpx;border-radius: 50%;" :src="userInfo.avatar ? userInfo.avatar : '/static/image/hd_img.png'"></image> -->
				<image style="width:105rpx;height: 105rpx;border-radius: 50%;" src="/static/image/hd_img.png"></image>
				<view>{{userInfo.name || '未知昵称'}}</view>
			</view>
			<image class="icon-arrow" src="/static/image/icon-userArrow.png"></image>
		</view>
	</view>
</template>

<script>
	import {
		getUserInfo
	} from '@/api/my.js'
	export default {
		data() {
			return {
				userInfo: {},
			};
		},
		onShow() {
			this.getUserInfo();
		},
		methods: {
			getUserInfo() {
				getUserInfo().then((r) => {
					console.log('r===', r.data)
					this.userInfo = r.data;
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.info-wrap {
		width: 90%;
		margin: 10rpx auto;
		background: #F5F1E9;
		border-radius: 10rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 14rpx 34rpx;
		box-sizing: border-box;

		.icon-arrow {
			width: 33rpx;
			height: 27rpx;
			margin-left: 20rpx;
		}
	}
</style>